home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Externalize⁄Internalize Problem < prev    next >
Encoding:
Internet Message Format  |  1996-07-30  |  1.4 KB  |  [TEXT/ttxt]

  1. Subject:     Externalize/Internalize Problem
  2. Sent:        7/24/96 10:42 AM
  3. Received:    7/24/96 9:55 AM
  4. From:        Paul Mylchreest, paulm@teamsoft.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Dear ODF team,
  9.  
  10. My Externalize/Internalize is in two steps.
  11.  
  12. void CMyContent::Externalize(...)
  13. {
  14.     ExternalizeProxyList(ev, storageUnit, cloneInfo);
  15.     ExternalizeMyData(ev, storageUnit, cloneInfo);
  16. }
  17.  
  18. FW_Boolean CMyContent::Internalize(...)
  19. {
  20.     FW_Boolean bResult = false;
  21.  
  22.     if (storageUnit->Exists(ev, kODPropContents, fMyPart->GetPartKind(ev), 0))
  23.     {
  24.         InternalizeProxyList(ev, storageUnit, cloneInfo);
  25.         InternalizeMyData(ev, storageUnit, cloneInfo);
  26.     //....
  27.     bResult = true;
  28.   }
  29.   return bResult;
  30. }
  31.  
  32. Like ODFDraw, in ExternalizeProxyList(), I write out the proxy count and
  33. read it in InternalizeProxyList().  Now, the problem. When I read in the
  34. count, it is garbage instead of zero. BTW, this does not happen when I do
  35. not call ExternalizeMyData() and InternalizeMyData().
  36.  
  37. This also does not happen if I do this process in only one step and use the
  38. same stream for the proxy list and the data.
  39.  
  40. What am I doing wrong?
  41.  
  42. Thank you!
  43.  
  44.  
  45. ______________________________________________________________________
  46. Paul Mylchreest                                     paulm@teamsoft.com
  47. Teamsoft, Inc.
  48. ______________________________________________________________________
  49.  
  50.  
  51.